package com.zto.mybatis.custom2.config;

import java.io.IOException;

/**
 * Created by xingyuchao on 2017-07-09.
 */
public class MyConfiguration {

    private String scanPath;

    private MapperRegistory mapperRegistory = new MapperRegistory();

    public MyConfiguration scanPath(String scanPath){
        this.scanPath = scanPath;
        return this;
    }

    public void build() throws IOException{
        if(null == scanPath || scanPath.length() < 1 ){
            throw new RuntimeException("scan path is required .");
        }
    }

    public MapperRegistory getMapperRegistory() {
        return mapperRegistory;
    }

    public static void main(String[] args) throws IOException {
        new MyConfiguration().scanPath("com.zto.mybatis.custom2.config.mappers").build();
    }

}
